﻿@model CategoryModel
@{
    Layout = "~/Views/Shared/_Root.cshtml";
    Html.AddTitleParts(!String.IsNullOrEmpty(Model.MetaTitle) ? Model.MetaTitle : Model.Name);
}
@using Nop.Core;
@using Nop.Core.Domain.Common;
@using Nop.Core.Infrastructure;
@using Nop.Web;
@using Nop.Web.Framework.UI;
@using Nop.Web.Models.Catalog;
@using Nop.Web.Extensions;
@*product search box*@
@Html.Action("SearchBox", "Catalog")
<div class="category-page">   

    @Html.Action("WidgetsByZone", "Widget", new { widgetZone = "mobile_categorydetails_top" })

    @*description*@
    @if (!String.IsNullOrWhiteSpace(Model.Description))
    {
        <div class="category-description">
            @Html.Raw(Model.Description)
        </div>
        <div class="clear">
        </div>
    }
    
    @Html.Action("WidgetsByZone", "Widget", new { widgetZone = "mobile_categorydetails_before_subcategories" })
    
    @*subcategories*@
    @if (Model.SubCategories.Count > 0)
    {
        <div class="sub-category-grid">
            <ul data-role="listview" data-inset="true" data-filter="false">
            @foreach (var category in Model.SubCategories)
            {
                <li><a href="@Url.RouteUrl("Category", new { categoryId = category.Id, SeName = category.SeName })">
                    @category.Name</a></li>
            }
            </ul>
        </div>
        <div class="clear">
        </div>
    }
        
    @Html.Action("WidgetsByZone", "Widget", new { widgetZone = "mobile_categorydetails_before_featured_products" })
    
    @*featured products*@
    @if (Model.FeaturedProducts.Count > 0)
    {
        <div class="featured-product-grid">
            <div class="title">
                @T("Products.FeaturedProducts")
            </div>
            <div class="product-list">
                <ul data-role="listview" data-inset="true" data-filter="false" data-theme="c">
                    @foreach (var product in Model.FeaturedProducts)
                    {
                        <li>
                            @Html.Partial("_ProductBox", product)
                        </li>
                    }
                </ul>
            </div>
        </div>
        <div class="clear">
        </div>
    }
    
    @Html.Action("WidgetsByZone", "Widget", new { widgetZone = "mobile_categorydetails_before_product_list" })
    
    @*product list*@
    @if (Model.Products.Count > 0)
    {
        <div class="product-list">
            <ul data-role="listview" data-inset="true" data-filter="false" data-theme="c">
                @foreach (var product in Model.Products)
                {
                    <li>
                        @Html.Partial("_ProductBox", product)
                    </li>
                }
            </ul>
        </div>
    }
    
    <div class="clear">
    </div>
                
    <div class="pager">
    @Html.Pager(Model.PagingFilteringContext).QueryParam("pagenumber")
    </div>

    @Html.Action("WidgetsByZone", "Widget", new { widgetZone = "mobile_categorydetails_bottom" })
</div>
